import { defineComponent } from 'vue';
import '@src/modules/intelligentQuality/components/style/baseChange.scss';

export default defineComponent({
  name: 'qualityBaseChange',
  methods: {
    changeHandler(item) {
      this.$emit('change', item);
    }
  },
  emits: ['change'],
  props: {
    value: {
      type: String,
      default: 'list'
    }
  },
  render() {
    return (
      <div class="quality-baseChange">
        <div
          class={{
            'change-item': true,
            'active': this.value === 'list'
          }}
          onClick={() => this.changeHandler('list')}
        >
          <i class={'iconfont icon-yifabu'}></i>
        </div>
        <div
          class={{
            'change-item': true,
            'active': this.value === 'card'
          }}
          onClick={() => this.changeHandler('card')}
        >
          <i class={'iconfont icon-appstore'}></i>
        </div>
      </div>
    );
  }
});
